﻿<?php
	
	
	
	
	function send_mail($to, $subject = '(No subject)', $message = '')
	{ 
		require 'PHPMailer/PHPMailerAutoload.php';
		//$to = "sw3nn3@gmail.com"; //KOMMENTERA BORT DENNA  ELLER ÄNDRA
		$from_user = "Sales Makeover Admin";
		$from_email = "info@twentyfiveentertainment.com";
		
		$mail = new PHPMailer;

		$mail->isSMTP();                                      // Set mailer to use SMTP
		
		/*$mail->Host = 'smtp.gmail.com';  // Specify main and backup server
		$mail->Port = 465;  // Specify main and backup server
		$mail->SMTPAuth = true;                               // Enable SMTP authentication
		$mail->Username = 'sw3nn3@gmail.com';                            // SMTP username
		$mail->Password = 'panamakanalen';                           // SMTP password
		$mail->SMTPSecure = 'ssl';                            // Enable encryption, 'ssl' also accepted*/
		
		$mail->Host = 'mail.twentyfiveentertainment.com';  // Specify main and backup server
		$mail->Port = 587;  // Specify main and backup server
		$mail->SMTPAuth = true;                               // Enable SMTP authentication
		$mail->Username = 'info@twentyfiveentertainment.com';                            // SMTP username
		$mail->Password = 'intlol=25';                           // SMTP password
		$mail->SMTPSecure = 'tls';                            // Enable encryption, 'ssl' also accepted
		
		$mail->From = $from_email;
		$mail->FromName = $from_user;
		//$mail->addAddress('josh@example.net', 'Josh Adams');  // Add a recipient
		$mail->addAddress($to);               // Name is optional
		//$mail->addReplyTo('info@example.com', 'Information');
		//$mail->addCC('cc@example.com');
		//$mail->addBCC('bcc@example.com');

		$mail->WordWrap = 50;                                 // Set word wrap to 50 characters
		//$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
		//$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
		$mail->isHTML(true);                                  // Set email format to HTML
		$mail->CharSet = 'UTF-8';
		$mail->Subject = $subject;
		$mail->Body    = $message;
		//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

		if(!$mail->send()) {
		   //echo 'Message could not be sent.';
		   //echo 'Mailer Error: ' . $mail->ErrorInfo;
		   exit;
		}

		//echo 'Message has been sent';
	}
	
	function sendNewUserEmail($to, $newUser, $newUserCompany)
	{
		/*$subject = 'Sales Makeover - Ny användare';
		
		$message = '
		<html>
		<head>
		  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		  <title>'.$subject.'</title>
		</head>
		<body>
		  En ny användare har lagts till i '.$newUserCompany.'.
		  <br/>
		  '.$newUser.'
		</body>
		</html>
		';
		
		send_mail($to, $subject, $message);*/
	}
	
	function sendNewManagerEmail($to, $newManager, $newManagerCompany)
	{
		/*$subject = 'Sales Makeover - Ny manager';
		
		$message = '
		<html>
		<head>
		  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		  <title>'.$subject.'</title>
		</head>
		<body>
		  En ny manager har lagts till i '.$newManagerCompany.'.
		  <br/>
		  '.$newManager.'
		</body>
		</html>
		';
		
		send_mail($to, $subject, $message);*/
	}
	
	function sendNewCompanyEmail($to, $newCompany, $newManager)
	{
		/*$subject = 'Sales Makeover - Nytt företag';
		
		$message = '
		<html>
		<head>
		  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		  <title>'.$subject.'</title>
		</head>
		<body>
		  Ett nytt företag har lagts till i systemet tillsammans med en ny manager.
		  <br/>
		  '.$newCompany.'
		  <br/>
		  '.$newManager.'
		</body>
		</html>
		';
		
		send_mail($to, $subject, $message);*/
	}
	
	function sendAccountInfo($to, $usersname, $key)
	{
		/*$hostURL = "http://twentyfiveentertainment.com/Apps/Sales%20MakeOver%20Mobile";
	
		$subject = 'Sales Makeover - Kontoinformation';
		
		$message = '
		<html>
		<head>
		  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		  <title>'.$subject.'</title>
		</head>
		<body>
		  Hej ' . $usersname . '!<br/>
		  Din mail har blivit registerad hos Sales Makeover. Gå hit för att välja nytt lösenord och komma igång: <a href="'.$hostURL.'/reset.php?key=' . $key . '">'.$hostURL.'/reset.php?key=' . $key . '</a>
		</body>
		</html>
		';
		
		send_mail($to, $subject, $message);*/
	}
	
	function sendNewAccountInfo($to, $usersname, $key)
	{
		/*$hostURL = "http://twentyfiveentertainment.com/Apps/Sales%20MakeOver%20Mobile";
	
		$subject = 'Sales Makeover - Kontoinformation';
		
		$message = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Login Mail</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
            font-size: 100%;
            line-height: 1.6;
        }
        .button {
            font-size: 14px;
            background-color: #ce3690;
            text-align: center;
            cursor: pointer;
            color: white;
            border-radius: 3px;
            border: none!important;
            padding: 50px;
            padding-top: 10px;
            padding-bottom: 10px;
        }
            .button:hover {
                background-color: #a33481;
            }

            .button:active {
                background-color: #7a2d66;
            }

        .noDecoration, a:link, a:visited {
            text-decoration: none;
        }
    </style>
</head>
<body bgcolor="#f6f6f6">

    <table style="margin: 30px;">
        <tr>
            <td>
                <img src="http://twentyfiveentertainment.com/Apps/Sales%20MakeOver%20Mobile/content/salesmakeover_logo.png">
            </td>
        </tr>
        <tr>
            <td style="font-size: 17px; margin-left: 30px; margin-right: 30px; padding-top: 10px; margin-bottom: 30px" align="left">Hej ' . $usersname . '!</td>
        </tr>
        <tr>
            <td style="font-size: 12px; margin-left: 30px; margin-right: 30px; margin-top: 10px; margin-bottom: 30px" align="left">
                Ditt lösenord har blivit återställt hos Sales Makeover. Välj nytt lösenord via knappen nedan.
            </td>
        </tr>
        <tr>
            <td style="padding-top: 30px; font-size: 12px; margin-left: 30px; margin-right: 30px; margin-top: 10px; margin-bottom: 30px" align="left">
                <center>
                    <a href="'.$hostURL.'/reset.php?key=' . $key . '"><span class="button noDecoration">Activera</span></a>
            </td>
        </tr>
        <tr>
            <td style="font-size: 12px; margin: 30px; padding-top: 30px; color: GrayText;">
                <center>
                info@salesmakeover.se | +46(0)8651 25 00


            </td>
        </tr>
    </table>

</body>
</html>
		';
		
		send_mail($to, $subject, $message);*/
	}
	
	function sendNewInnovation($to,$Name,$Created,$CompanyName,$CustomerName,$Recommendation,$Problem,$Solution,$CustomerValue)
	{
  
    $Creater=$Name;
    $Date= date('y-m-d', time());
    $CompanyName=$CompanyName;
    $Contact=$CustomerName;
    $InfoOne=$Recommendation;
    $InfoTwo=$Problem;
    $InfoThree=$Solution;
    $InfoFour=$CustomerValue;
    
  
		/*$hostURL = "https://twentyfiveentertainment.com/Apps/Sales%20MakeOver%20Mobile";*/
	
		$subject = 'Sales Makeover - Ny Innovation';
		
		$message = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Sales makeover</title>

</head>

<body bgcolor="#f6f6f6">

    <table>
        <tr>
            <td>
                <center>
                    <img width="96%" src="http://twentyfiveentertainment.com/Apps/Sales%20MakeOver%20Mobile/content/mail_content.png">
                </center>
            </td>
        </tr>
        <tr>
            <td style="font-family:  Helvetica, Arial, sans-serif; padding-left: 2%; padding-top: 20px;">UTFÖRT AV:</td>
        </tr>

        <tr>
            <td style="font-size: 45px; font-family:  Helvetica, Arial, sans-serif; padding-left: 2%; padding-top: 20px;">'.$Creater.'</td>
        </tr>
    </table>

    <table width="96%" style="margin-left: 2%; border-bottom: #ce3690 2px solid;">
        <tr style="font-size: 13px; font-family:  Helvetica, Arial, sans-serif;">
            <td><b>DATUM:'.$Date.'</b></td>
            <td style="padding-left: 1%;"><b>FÖRETAG: '.$CompanyName.'</b></td>
            <td style="padding-left: 1%;"><b>KONTAKTPERSON: '.$Contact.'</b></td>
        </tr>
    </table>

    <table width="96%" style="margin-left: 2%; margin-top: 15px;">
        <tr style="font-size: 30px; color: #ce3690; font-family:  Helvetica, Arial, sans-serif;">
            <td><b>IDÉ</b></td>
        </tr>
        <tr style="font-size: 12px; margin-left: 2%; width: 70%; font-family:  Helvetica, Arial, sans-serif;">
            <td>'.$InfoOne.'</td>
        </tr>
    </table>

    <table width="96%" style="margin-left: 2%; margin-top: 15px; border-top: #ce3690 2px solid;">
        <tr style="font-size: 30px; color: #ce3690; font-family:  Helvetica, Arial, sans-serif;">
            <td style="padding-top: 15px;"><b>SMÄRTA</b></td>
        </tr>
        <tr style="font-size: 12px; margin-left: 2%; width: 70%; font-family:  Helvetica, Arial, sans-serif;">
            <td>'.$InfoTwo.'</td>
        </tr>
    </table>

    <table width="96%" style="margin-left: 2%; margin-top: 15px; border-top: #ce3690 2px solid;">
        <tr style="font-size: 30px; color: #ce3690; font-family:  Helvetica, Arial, sans-serif;">
            <td style="padding-top: 15px;"><b>LÖSNING</b></td>
        </tr>
        <tr style="font-size: 12px; margin-left: 2%;  font-family: Helvetica, Arial, sans-serif;">
            <td>'.$InfoThree.'</td>
        </tr>
    </table>

    <table width="96%" style="margin-left: 2%; margin-top: 15px; border-top: #ce3690 2px solid;">
        <tr style="font-size: 30px; color: #ce3690; font-family:  Helvetica, Arial, sans-serif;">
            <td style="padding-top: 15px;"><b>FÖRSLAG TILL NÄSTA STEG</b></td>
        </tr>
        <tr style="font-size: 12px; margin-left: 2%; width: 70%; font-family:  Helvetica, Arial, sans-serif;">
            <td>'.$InfoFour.'</td>
        </tr>
    </table>

    <center>


            <table style="margin-left:2%; font-size:12px;margin-top:50px; color:#ce3690;"  align="left">
                <tr>
                    <td>Sales Makeover, Solution Selling Business Partners, Fredrikslundsvägen 2., S-168 34, Bromma
                        Tel: 08 651 25 00, Fax: 08 651 25 05, Website: http://salesmakeover.se, Email: info@salesmakeover.se
         
                    </td>
                </tr>
            </table>
    </center>

</body>
</html>
		';
		
		send_mail($to, $subject, $message);


	}
	
	
?>